package me.zhengjie.modules.system.repository;

import me.zhengjie.modules.system.domain.SafeRiskItem;
import me.zhengjie.modules.system.domain.SafeRiskType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * SafeRiskItemRepository
 *
 * @author guoyuan
 * @version 1.0.0
 * @since 1.0.0
 */
public interface SafeRiskItemRepository extends JpaRepository<SafeRiskItem, String>, JpaSpecificationExecutor<SafeRiskItem> {

    /**
     * 根据场景风险类别删除所有场景风险项
     *
     * @param safeRiskType 场景风险类别
     */
    void deleteAllBySafeRiskType(SafeRiskType safeRiskType);

    /**
     * 根据场景风险类别查询所有场景风险项
     *
     * @param safeRiskType 场景风险类别列表
     * @return 场景风险项列表
     */
    List<SafeRiskItem> findAllBySafeRiskTypeIn(List<SafeRiskType> safeRiskType);
}
